<?php
function __autoload($class){
	$class_path = LIB_PATH. '/class/' . $class. '.php';
	if (substr($class, -4) == 'odel') {
        $class_path = LIB_PATH . '/model/'.$class.'.php';
    }
	if (substr($class, -4) == 'ller') {
		$class_path = LIB_PATH . '/controller/'.$class.'.php';
	}
	if (substr($class, -3) == 'iew') {
		$class_path = LIB_PATH . '/view/'.$class.'.php';
	} 
	if (substr($class, -3) == 'per') {
		$class_path = LIB_PATH . '/mapper/'.$class.'.php';
	}
	
	
	include($class_path);
	
	//TODO: провереть наличия прописанного путя))
}

?>
